package com.cn.test;

public class PossibleReordering {
	static int x = 0, y = 0;
	static int a = 0, b = 0;

	public static void main(String[] args) throws InterruptedException {
		Thread one = new Thread() {
			
			public void run() {
				System.out.println("one start");
				a = 1;
				x = b;
				System.out.println("one end");
			}
		};

		Thread other = new Thread() {
			public void run() {
				System.out.println("other start");
				b = 1;
				y = a;
				System.out.println("other end");
			}
		};
		one.start();
		other.start();
		one.join();
		other.join();
		System.out.println("x:" + x + ",y:" + y);
	}
}